<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>laydate测试</title>
  <style>
    li {
      list-style: none;
    }
  </style>
  <script src="laydate/laydate.js"></script>
</head>
<body>

<input placeholder="请输入日期" class="laydate-icon" onclick="laydate()">
<br>
<br>

<input class="laydate-icon" id="demo" value="2014-6-25">
<script type="text/javascript">
  laydate({
    elem: '#demo'
  })
</script>
<br>
<br>

开始日：<li class="laydate-icon" id="start" style="width:200px; margin-right:10px;"></li>
结束日：<li class="laydate-icon" id="end" style="width:200px;"></li>
<script>
  var start = {
    elem: '#start',
    format: 'YYYY/MM/DD hh:mm:ss',
    min: laydate.now(), //设定最小日期为当前日期
    max: '2099-06-16 23:59:59', //最大日期
    istime: true,
    istoday: false,
    choose: function (datas) {
      end.min = datas; //开始日选好后，重置结束日的最小日期
      end.start = datas //将结束日的初始值设定为开始日
    }
  }
  var end = {
    elem: '#end',
    format: 'YYYY/MM/DD hh:mm:ss',
    min: laydate.now(),
    max: '2099-06-16 23:59:59',
    istime: true,
    istoday: false,
    choose: function (datas) {
      start.max = datas; //结束日选好后，重置开始日的最大日期
    }
  }
  laydate(start)
  laydate(end)
</script>
</body>
</html>